<?php
/**
 * wp-foundation dynamic-banner.php
 */
?>
<?php // Banner Footer scripts
function foundation_banner_footer_files(){ ?>
    <?php if (is_home() || is_front_page()){ 
		global $options;
foreach ($options as $value) {
if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
if ($fd_enable_home_banner == 'Enable'){
	?>
    <script type="text/javascript">
    jQuery(document).ready(function($) {	
		//home page splash transition
		if ($('#s1').length){
		$('#s1').after('<div id="splashNav">').cycle({ 
		<?php if(strlen($fd_home_banner_custom_effect) == "") { ?>
			fx:      '<?php echo $fd_home_banner_effect ?>', 
			speed:   '<?php echo $fd_home_banner_effect_speed ?>',
			pause:   <?php echo $fd_home_banner_pause ?>,
			timeout: <?php echo $fd_home_banner_timeout ?>,
			<?php if($fd_home_banner_nav == 'Enable'){ ?>
			next: '#splashNext',
			prev: '#splashPrev',
			<?php } ?>
			<?php if($fd_home_banner_pager == 'Enable'){ ?>
			pager:   '#splashNav',
			<?php } ?>
		<?php } else { echo stripslashes($fd_home_banner_custom_effect);}?>
		});
		}
		// END: home page splash transition
	});
	</script>
    
<?php }	} }
add_action('wp_footer', 'foundation_banner_footer_files', 10);
// END :Footer scripts

// Foundation / cycle splash
function foundation_home_splash(){
	global $options;
foreach ($options as $value) {
if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
if ($fd_enable_home_banner == 'Enable'){
if (is_home() || is_front_page()){
	$splash = "\n<!-- begin splash area -->\n";
	$splash .= '<section id="splash">';
	$splash .= '<div id="splash-pic-wrap" class="wrapper">';
	$splash .= "\n\t";
	if($fd_home_banner_nav == 'Enable'){
		$splash .= "<div id='splashNP'><a id='splashPrev' href='#'>Prev</a> <a id='splashNext' href='#'>Next</a></div>";
	}
	$splash .= '<div id="s1" class="splashpics">';
	
	//splash 1
	$splash .= "\n\t";
	$splash .= '<div class="splash1">';
	if ($fd_slide1_content == "image" || $fd_slide1_content == "image and text"){
		$splash .= '<a href="'.$fd_image1_link.'" class="splash1-image" ';
		if ($fd_slide1_add_as_background == "YES"){
			$splash .= 'title="'.$fd_image1_title.'" style="display:block;background: url('.$fd_image1_url.') no-repeat top center;width:'.$fd_image1_width.';height:'.$fd_image1_height.'"';
		}
		$splash .= '>';
		$splash .= "\n\t\t";
		if ($fd_slide1_add_as_background == "NO"){
			$splash .= '<img src="'.$fd_image1_url.'" alt="'.$fd_image1_alt.'" title="'.$fd_image1_title.'" width="'.$fd_image1_width.'" height="'.$fd_image1_height.'" />';
		}
		if ($fd_slide1_content == "text" || $fd_slide1_content == "image and text"){
			$splash .= '<div class="splash-text"><p>'.stripslashes($fd_slide1_text).'</p></div>';
		}
		$splash .= '</a>';
	}
	
	$splash .= '</div>';
	
	//splash 2
	if ($fd_image2_active == 'Enable'){
	$splash .= "\n\t";
	$splash .= '<div class="splash2">';
	if ($fd_slide2_content == "image" || $fd_slide2_content == "image and text"){
		$splash .= '<a href="'.$fd_image2_link.'" class="splash2-image" ';
		if ($fd_slide2_add_as_background == "YES"){
			$splash .= 'title="'.$fd_image2_title.'" style="display:block;background: url('.$fd_image2_url.') no-repeat top center;width:'.$fd_image2_width.';height:'.$fd_image2_height.'"';
		}
		$splash .= '>';
		$splash .= "\n\t\t";
		if ($fd_slide2_add_as_background == "NO"){
			$splash .= '<img src="'.$fd_image2_url.'" alt="'.$fd_image2_alt.'" title="'.$fd_image2_title.'" width="'.$fd_image2_width.'" height="'.$fd_image2_height.'" />';
		}
		if ($fd_slide2_content == "text" || $fd_slide2_content == "image and text"){
			$splash .= '<div class="splash-text"><p>'.stripslashes($fd_slide2_text).'</p></div>';
		}
		$splash .= '</a>';
	}
	$splash .= '</div>';
	}
	
	//splash 3
	if ($fd_image3_active == 'Enable'){
	$splash .= "\n\t";
	$splash .= '<div class="splash3">';
	if ($fd_slide3_content == "image" || $fd_slide3_content == "image and text"){
		$splash .= '<a href="'.$fd_image3_link.'" class="splash3-image" ';
		if ($fd_slide3_add_as_background == "YES"){
			$splash .= 'title="'.$fd_image3_title.'" style="display:block;background: url('.$fd_image3_url.') no-repeat top center;width:'.$fd_image3_width.';height:'.$fd_image3_height.'"';
		}
		$splash .= '>';
		$splash .= "\n\t\t";
		if ($fd_slide3_add_as_background == "NO"){
			$splash .= '<img src="'.$fd_image3_url.'" alt="'.$fd_image3_alt.'" title="'.$fd_image3_title.'" width="'.$fd_image3_width.'" height="'.$fd_image3_height.'" />';
		}
		if ($fd_slide3_content == "text" || $fd_slide3_content == "image and text"){
			$splash .= '<div class="splash-text"><p>'.stripslashes($fd_slide3_text).'</p></div>';
		}
		$splash .= '</a>';
	}
	$splash .= '</div>';
	}
	
	//splash 4
	if ($fd_image4_active == 'Enable'){
	$splash .= "\n\t";
	$splash .= '<div class="splash4">';
	if ($fd_slide4_content == "image" || $fd_slide4_content == "image and text"){
		$splash .= '<a href="'.$fd_image4_link.'" class="splash4-image" ';
		if ($fd_slide4_add_as_background == "YES"){
			$splash .= 'title="'.$fd_image4_title.'" style="display:block;background: url('.$fd_image4_url.') no-repeat top center;width:'.$fd_image4_width.';height:'.$fd_image4_height.'"';
		}
		$splash .= '>';
		$splash .= "\n\t\t";
		if ($fd_slide4_add_as_background == "NO"){
			$splash .= '<img src="'.$fd_image4_url.'" alt="'.$fd_image4_alt.'" title="'.$fd_image4_title.'" width="'.$fd_image4_width.'" height="'.$fd_image4_height.'" />';
		}
		if ($fd_slide4_content == "text" || $fd_slide4_content == "image and text"){
			$splash .= '<div class="splash-text"><p>'.stripslashes($fd_slide4_text).'</p></div>';
		}
		$splash .= '</a>';
	}
	$splash .= '</div>';
	}
	
	//splash 5
	if ($fd_image5_active == 'Enable'){
	$splash .= "\n\t";
	$splash .= '<div class="splash5">';
	if ($fd_slide5_content == "image" || $fd_slide5_content == "image and text"){
		$splash .= '<a href="'.$fd_image5_link.'" class="splash5-image" ';
		if ($fd_slide5_add_as_background == "YES"){
			$splash .= 'title="'.$fd_image5_title.'" style="display:block;background: url('.$fd_image5_url.') no-repeat top center;width:'.$fd_image5_width.';height:'.$fd_image5_height.'"';
		}
		$splash .= '>';
		$splash .= "\n\t\t";
		if ($fd_slide5_add_as_background == "NO"){
			$splash .= '<img src="'.$fd_image5_url.'" alt="'.$fd_image5_alt.'" title="'.$fd_image5_title.'" width="'.$fd_image5_width.'" height="'.$fd_image5_height.'" />';
		}
		if ($fd_slide5_content == "text" || $fd_slide5_content == "image and text"){
			$splash .= '<div class="splash-text"><p>'.stripslashes($fd_slide5_text).'</p></div>';
		}
		$splash .= '</a>';
	}
	$splash .= '</div>';
	}
	//end splash
	$splash .= "\n\t";
	$splash .= '</div>';
	$splash .= "\n";
	$splash .= '</div></section>';
	$splash .= "\n<!-- end splash area -->\n";
	
	echo apply_filters('foundation_home_splash', $splash);
}
}
}

// END: Foundation / cycle splash ?>